package com.chc.web.fee_park.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chc.web.fee_park.entity.FeePark;
import com.chc.web.fee_park.entity.FeeParkParm;
import com.chc.web.fee_park.mapper.FeeParkMapper;
import com.chc.web.fee_park.service.FeeParkService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/01/19/14:43
 * @Description:
 */
@Service
public class FeeParkServiceImpl extends ServiceImpl<FeeParkMapper, FeePark> implements FeeParkService {
    @Override

    public IPage<FeePark> getList(FeeParkParm feeParkParm) {
        //构造分页对象
        IPage<FeePark> page = new Page<>();
        page.setCurrent(feeParkParm.getCurrentPage());
        page.setSize(feeParkParm.getPageSize());
        return this.baseMapper.getList(page,feeParkParm.getUserName(),feeParkParm.getParkName());
    }

    @Override
    public List<FeePark> getListPark(Long userId) {
        return this.baseMapper.getListPark(userId);
    }

    @Override
    public List<Integer> selectSevenMonthConsumptionList() {
        return this.baseMapper.selectSevenMonthConsumptionList();
    }

}
